using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Raster._MosaicDataset
{
    /// <summary>
    /// <para>Define Overviews</para>
    /// <para>Lets you set how mosaic dataset overviews are generated. The settings made with this tool are used by the Build Overviews tool.</para>
    /// <para>用于设置镶嵌数据集概视图的生成方式。使用此工具进行的设置由“构建概视图”工具使用。</para>
    /// </summary>    
    [DisplayName("Define Overviews")]
    public class DefineOverviews : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public DefineOverviews()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_mosaic_dataset">
        /// <para>Mosaic Dataset</para>
        /// <para>The mosaic dataset that you want to build overviews on.</para>
        /// <para>要在其上构建概视图的镶嵌数据集。</para>
        /// </param>
        public DefineOverviews(object _in_mosaic_dataset)
        {
            this._in_mosaic_dataset = _in_mosaic_dataset;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Define Overviews";

        public override string CallName => "management.DefineOverviews";

        public override List<string> AcceptEnvironments => ["extent", "parallelProcessingFactor", "tileSize"];

        public override object[] ParameterInfo => [_in_mosaic_dataset, _overview_image_folder, _in_template_dataset, _extent, _pixel_size, _number_of_levels, _tile_rows, _tile_cols, _overview_factor, _force_overview_tiles.GetGPValue(), _resampling_method.GetGPValue(), _compression_method, _compression_quality, _out_mosaic_dataset];

        /// <summary>
        /// <para>Mosaic Dataset</para>
        /// <para>The mosaic dataset that you want to build overviews on.</para>
        /// <para>要在其上构建概视图的镶嵌数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Mosaic Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_mosaic_dataset { get; set; }


        /// <summary>
        /// <para>Output Location</para>
        /// <para>The folder or geodatabase to store the overviews.</para>
        /// <para>用于存储概视图的文件夹或地理数据库。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Location")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _overview_image_folder { get; set; } = null;


        /// <summary>
        /// <para>Extent from Dataset</para>
        /// <para>A raster dataset or feature class to define the extent of the overviews.</para>
        /// <para>用于定义概视图范围的栅格数据集或要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extent from Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_template_dataset { get; set; } = null;


        /// <summary>
        /// <para>Extent</para>
        /// <para><xdoc>
        ///   <para>Manually set the extent using the following minimum and maximum x and y coordinates.</para>
        ///   <para>The mosaic dataset boundary will determine the extent of the overviews if you do not define an extent.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>使用以下最小和最大 x 和 y 坐标手动设置范围。</para>
        ///   <para>如果未定义范围，镶嵌数据集边界将确定概视图的范围。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extent")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _extent { get; set; } = null;


        /// <summary>
        /// <para>Pixel Size</para>
        /// <para><xdoc>
        ///   <para>If you prefer not to use all the raster's pyramids, specify a base pixel size at which your overviews will be generated.</para>
        ///   <para>The units for this parameter are the same as the spatial reference of the mosaic dataset.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>如果不想使用栅格的所有金字塔，请指定生成概视图的基本像素大小。</para>
        ///   <para>此参数的单位与镶嵌数据集的空间参考相同。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Pixel Size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _pixel_size { get; set; } = null;


        /// <summary>
        /// <para>Number Of Levels</para>
        /// <para>Specify the number of levels of overviews that you want to generate overviews. A value of -1 will determine an optimal value for you.</para>
        /// <para>指定要生成概视图的概视图的级别数。值 -1 将为您确定最佳值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number Of Levels")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _number_of_levels { get; set; } = null;


        /// <summary>
        /// <para>Number Of Rows</para>
        /// <para><xdoc>
        ///   <para>Set the number of rows (in pixels) for each tile.</para>
        ///   <para>Larger values will result in fewer, larger individual overviews, and increase the likelihood that you will need to regenerate lower level overviews. A smaller value will result in more, smaller files.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>设置每个磁贴的行数（以像素为单位）。</para>
        ///   <para>值越大，单个概览就越少，单个概览就越大，并且需要重新生成较低级别的概览的可能性也会增加。值越小，文件越多，越小。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number Of Rows")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _tile_rows { get; set; } = 5120;


        /// <summary>
        /// <para>Number Of Columns</para>
        /// <para><xdoc>
        ///   <para>Set the number of columns (in pixels) for each tile.</para>
        ///   <para>Larger values will result in fewer, larger individual overviews, and increase the likelihood that you will need to regenerate lower level overviews. A smaller value will result in more, smaller files.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>设置每个磁贴的列数（以像素为单位）。</para>
        ///   <para>值越大，单个概览就越少，单个概览就越大，并且需要重新生成较低级别的概览的可能性也会增加。值越小，文件越多，越小。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number Of Columns")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _tile_cols { get; set; } = 5120;


        /// <summary>
        /// <para>Overview Sampling Factor</para>
        /// <para>Set a ratio to determine the size of the next overview. For example, if the cell size of the first level is 10, and the overview factor is 3, then the next overview pixel size will be 30.</para>
        /// <para>设置一个比率以确定下一个概览的大小。例如，如果第一级的像元大小为 10，而总览因子为 3，则下一个总像素大小将为 30。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Overview Sampling Factor")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _overview_factor { get; set; } = 3;


        /// <summary>
        /// <para>Force Overview Tiles</para>
        /// <para><xdoc>
        ///   <para>Generate overviews at all levels, or only above existing pyramid levels.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Create overviews above the raster pyramid levels. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Create overviews at all levels.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>生成所有级别的概览，或仅生成现有金字塔级别的概览。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 在栅格金字塔级别上方创建概视图。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 创建所有级别的概视图。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Force Overview Tiles")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _force_overview_tiles_value _force_overview_tiles { get; set; } = _force_overview_tiles_value._false;

        public enum _force_overview_tiles_value
        {
            /// <summary>
            /// <para>FORCE_OVERVIEW_TILES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FORCE_OVERVIEW_TILES")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_FORCE_OVERVIEW_TILES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_FORCE_OVERVIEW_TILES")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Resampling Method</para>
        /// <para><xdoc>
        ///   <para>Choose an algorithm for aggregating pixel values in the overviews.</para>
        ///   <bulletList>
        ///     <bullet_item>Nearest—The fastest resampling method because it minimizes changes to pixel values. Suitable for discrete data, such as land cover. If the Raster MetadataData Type is thematic, then nearest neighbor will be the default.</bullet_item><para/>
        ///     <bullet_item>Bilinear—Calculates the value of each pixel by averaging (weighted for distance) the values of the surrounding 4 pixels. Suitable for continuous data.This is the default, unless the Raster Metadata Data Type is thematic.</bullet_item><para/>
        ///     <bullet_item>Cubic— Calculates the value of each pixel by fitting a smooth curve based on the surrounding 16 pixels. Produces the smoothest image, but can create values outside of the range found in the source data. Suitable for continuous data.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>选择用于在概视图中聚合像素值的算法。</para>
        ///   <bulletList>
        ///     <bullet_item>最近 - 最快的重采样方法，因为它可以最大程度地减少对像素值的更改。适用于离散数据，例如土地覆盖。如果栅格元数据数据类型为主题，则最近邻将是默认值。</bullet_item><para/>
        ///     <bullet_item>双线性 - 通过对周围 4 个像素的值进行平均（按距离加权）来计算每个像素的值。适用于连续数据。这是默认设置，除非栅格元数据数据类型为主题。</bullet_item><para/>
        ///     <bullet_item>立方体 （Cubic） — 通过基于周围的 16 个像素拟合平滑曲线来计算每个像素的值。生成最平滑的图像，但可能会创建源数据中查找的范围之外的值。适用于连续数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Resampling Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _resampling_method_value _resampling_method { get; set; } = _resampling_method_value._BILINEAR;

        public enum _resampling_method_value
        {
            /// <summary>
            /// <para>Nearest</para>
            /// <para>Nearest—The fastest resampling method because it minimizes changes to pixel values. Suitable for discrete data, such as land cover. If the Raster MetadataData Type is thematic, then nearest neighbor will be the default.</para>
            /// <para>最近 - 最快的重采样方法，因为它可以最大程度地减少对像素值的更改。适用于离散数据，例如土地覆盖。如果栅格元数据数据类型为主题，则最近邻将是默认值。</para>
            /// </summary>
            [Description("Nearest")]
            [GPEnumValue("NEAREST")]
            _NEAREST,

            /// <summary>
            /// <para>Bilinear</para>
            /// <para>Bilinear—Calculates the value of each pixel by averaging (weighted for distance) the values of the surrounding 4 pixels. Suitable for continuous data.This is the default, unless the Raster Metadata Data Type is thematic.</para>
            /// <para>双线性 - 通过对周围 4 个像素的值进行平均（按距离加权）来计算每个像素的值。适用于连续数据。这是默认设置，除非栅格元数据数据类型为主题。</para>
            /// </summary>
            [Description("Bilinear")]
            [GPEnumValue("BILINEAR")]
            _BILINEAR,

            /// <summary>
            /// <para>Cubic</para>
            /// <para>Cubic— Calculates the value of each pixel by fitting a smooth curve based on the surrounding 16 pixels. Produces the smoothest image, but can create values outside of the range found in the source data. Suitable for continuous data.</para>
            /// <para>立方体 （Cubic） — 通过基于周围的 16 个像素拟合平滑曲线来计算每个像素的值。生成最平滑的图像，但可能会创建源数据中查找的范围之外的值。适用于连续数据。</para>
            /// </summary>
            [Description("Cubic")]
            [GPEnumValue("CUBIC")]
            _CUBIC,

        }

        /// <summary>
        /// <para>Compression Method</para>
        /// <para><xdoc>
        ///   <para>Define the type of data compression to store the overview images.</para>
        ///   <bulletList>
        ///     <bullet_item>JPEG—A lossy compression. This is the default, unless the Raster Metadata Data Type is thematic. This compression method is only valid if the mosaic dataset items adhere to JPEG specifications.</bullet_item><para/>
        ///     <bullet_item>JPEG Luna and Chroma—A lossy compression using the luma (Y) and chroma (Cb and Cr) color space components.</bullet_item><para/>
        ///     <bullet_item>None—No data compression.</bullet_item><para/>
        ///     <bullet_item>LZW—A lossless compression. If the Raster Metadata Data Type is thematic, then nearest neighbor will be the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义用于存储概览图像的数据压缩类型。</para>
        ///   <bulletList>
        ///     <bullet_item>JPEG - 有损压缩。这是默认设置，除非栅格元数据数据类型为主题。仅当镶嵌数据集项目符合 JPEG 规范时，此压缩方法才有效。</bullet_item><para/>
        ///     <bullet_item>JPEG Luna 和 Chroma - 使用亮度 （Y） 和色度（Cb 和 Cr）色彩空间分量的有损压缩。</bullet_item><para/>
        ///     <bullet_item>无 - 无数据压缩。</bullet_item><para/>
        ///     <bullet_item>LZW - 无损压缩。如果栅格元数据数据类型为主题，则最近邻将是默认值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compression Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _compression_method { get; set; } = null;


        /// <summary>
        /// <para>Compression Quality</para>
        /// <para>Choose a value from 1 - 100. Higher values generate better quality outputs, but they create larger files.</para>
        /// <para>从 1 - 100 中选择一个值。值越高，输出质量越好，但文件越大。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compression Quality")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _compression_quality { get; set; } = 80;


        /// <summary>
        /// <para>Updated Mosaic Dataset</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Mosaic Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_mosaic_dataset { get; set; }


        public DefineOverviews SetEnv(object extent = null, object parallelProcessingFactor = null, double[] tileSize = null)
        {
            base.SetEnv(extent: extent, parallelProcessingFactor: parallelProcessingFactor, tileSize: tileSize);
            return this;
        }

    }

}